import * as Koa from 'koa'
import * as bodys from 'koa-body'
import loadRoutes from './utils/koa-decorts'
import {join} from 'path'

const app = new Koa();

app.use(bodys({
    multipart: true,  // formData对象 文件上传
    strict: false, // 严格模式 启用不解析GET, HEAD, DELETE方式请求
}))

const router = loadRoutes(join(__dirname,'./routes'));

app.use(router.routes());

app.listen(3000, () => {
    console.log('服务已开启 3000');
})